<!doctype html>
<html>
    <head>
        <title>AudioTrack &amp; VideoTrack garbage collection</title>
        <script src="../../resources/testharness.js"></script>
        <script src="../../resources/testharnessreport.js"></script>
            </head>
    <body>
        <script>
            async_test(function(t)
            {
                var video = document.createElement('video');
                video.src = '../content/test.ogv';

                video.addEventListener('loadedmetadata', t.step_func_done(function()
                {
                    video.audioTracks.foo = 'foo';
                    video.audioTracks[0].bar = 'bar';
                    video.videoTracks.baz = 'baz';
                    video.videoTracks[0].qux = 'qux';

                    gc();

                    assert_equals(video.audioTracks.foo, 'foo');
                    assert_equals(video.audioTracks[0].bar, 'bar');
                    assert_equals(video.videoTracks.baz, 'baz');
                    assert_equals(video.videoTracks[0].qux, 'qux');
                }));
            });
        </script>
    </body>
</html>
